package com.doform.android.xianggucheng.bean.request_bean;

import com.doform.android.xianggucheng.help.AppHelp;
import com.doform.android.xianggucheng.utils.TimeUtils;
import com.google.gson.Gson;

/**
 * 作者 Y_MS
 * Created by ${APEN} on 2017-07-31.
 * GitHub：https://github.com/cxydxpx
 */

public final class ReqHead {


    /**
     * Version : 2.0
     * Function : system.user.login
     * ReqTime : 20170724185304
     * ReqMsgId : 2881551a-6193-2bd3-a597-887b466d6826
     * thusertoken : userid-e55740e9-d384-3786-a665-6279a65dc669
     */

    private String Version = "2.0";
    private String Function;
    private String ReqTime = TimeUtils.getNowDateWithRequest();
    private String ReqMsgId = "2881551a-6193-2bd3-a597-887b466d6826";
    private String thusertoken = AppHelp.getInstance().getToken();

    public ReqHead(String function) {
        if (function == null) {
            throw new IllegalArgumentException("function can't be null");
        }
        this.Function = function;
    }

    public String getVersion() {
        return Version;
    }

    public String getFunction() {
        return Function;
    }

    public String getReqTime() {
        return ReqTime;
    }

    public String getReqMsgId() {
        return ReqMsgId;
    }

    public String getThusertoken() {
        return thusertoken;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}
